// ---------------------- cityStore ---------------------- //
export interface CityInfo {
  key: string;
  name: string;
}

export interface CityStoreState {
  cityInfo: CityInfo | null;
  cityList: Array<CityInfo>;
}

export interface CityStoreContextApi {
  getState: () => CityStoreState;
  setCityInfo: (newCityInfo: CityInfo) => void;
  setCityList: (cityList: Array<CityInfo>) => void;
  addCity: (city: CityInfo) => void;
  removeCity: (key: string) => void; 
  refreshAllCities: () => Promise<void>;
}

// ---------------------- fieldsStore ---------------------- //
export interface Field {
  key: string;
  name: string;
}

export interface FieldStoreApi {
  fieldList: Array<Field>;
  addField: (field: Field) => void;
  clearFields: () => void;
}

export interface LoginUser {
  token: string;
  expireTime: Date;

  username?: string;
  avatar?: string;
  email?: string;
  phone?: string;
  createTime?: Date;
  updateTime?: Date;
}

export interface LoginUserStoreApi {
  loginUser: Partial<LoginUser>;
  updateInfo: (user: Partial<LoginUser>) => void;
  clearInfo: () => void;
}
